package com.zy.oauth.feign;

import com.zy.config.dto.AppConfigDetailsDto;
import com.zy.config.entity.AppConfigDetails;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Map;

/**
 * @author 308237306_33141
 * @description:
 * @since 2023/3/19 15:03
 */
@FeignClient(
        name = "T-CONFIG",
        contextId = "t-config",
        url = "http://127.0.0.1:9081/"
)
@RequestMapping(value = "/config/config/")
@Validated
public interface ConfigFeign {


    @GetMapping({"propertyString"})
    @ApiOperation(
            value = "获取配置",
            notes = "获取配置"
    )
    String propertyToString(@NotBlank @RequestParam("appId") String appId);

    @GetMapping({"property"})
    @ApiOperation(
            value = "获取配置",
            notes = "获取配置"
    )
    String property(@NotBlank @RequestParam("appId") String appId);

    @GetMapping({"propertyToList"})
    @ApiOperation(
            value = "获取配置",
            notes = "获取配置"
    )
    List<AppConfigDetailsDto> propertyToList(@NotBlank @RequestParam("appId") String appId);
}
